phy: rockchip: naneng-combphy: compatible reset with old DT
authorChukun Pan <amadeus@jmu.edu.cn>
Mon, 6 Jan 2025 10:00:01 +0000 (18:00 +0800)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 6 Mar 2025 06:21:29 +0000 (07:21 +0100)
Origin: https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=3126ea9be66b53e607f87f067641ba724be24181
Origin: https://git.kernel.org/linus/3126ea9be66b53e607f87f067641ba724be24181
Bug-Debian: https://bugs.debian.org/1095745

The device tree of RK3568 did not specify reset-names before.
So add fallback to old behaviour to be compatible with old DT.

Fixes: fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset")
Cc: Jianfeng Liu <liujianfeng1994@gmail.com>
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://lore.kernel.org/r/20250106100001.1344418-2-amadeus@jmu.edu.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Gbp-Pq: Topic bugfix/arm64
Gbp-Pq: Name phy-rockchip-naneng-combphy-compatible-reset-with-ol.patch

drivers/phy/rockchip/phy-rockchip-naneng-combphy.c

index d97a7164c4964899b7c47fae613fc19e74c983cc..2c73cc8dd1edb287519d8b4f9e2de645a6b342aa 100644 (file)
@@ -299,7 +299,10 @@ static int rockchip_combphy_parse_dt(struct device *dev, struct rockchip_combphy
 
        priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk");
 
-       priv->phy_rst = devm_reset_control_get(dev, "phy");
+       priv->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
+       /* fallback to old behaviour */
+       if (PTR_ERR(priv->phy_rst) == -ENOENT)
+               priv->phy_rst = devm_reset_control_array_get_exclusive(dev);
        if (IS_ERR(priv->phy_rst))
                return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n");